home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / NCSA / tn3270 2.3d26 source / tn3270 / addshr.c next >
C/C++ Source or Header  |  1991-01-21  |  2KB  |  74 lines

  1. /*
  2.  *  tn3270 for the Macintosh Source Code
  3.  *  Brown University Computing and Information Services
  4.  *  Version 2.3d21, January 17, 1991
  5.  *  Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
  6.  *  Peter John DiCamillo.
  7.  *
  8.  *  Permission is granted to any individual or institution to use, copy,
  9.  *  or redistribute the binary version of this software and its
  10.  *  documentation provided this notice and the copyright notices are
  11.  *  retained.  Permission is granted to any individual or non-profit
  12.  *  institution to use, copy, modify, or redistribute the source files
  13.  *  of this software provided this notice and the copyright notices are
  14.  *  retained.  This software may not be distributed for profit, either
  15.  *  in original form or in derivative works, nor can the source be
  16.  *  distributed to other than an individual or a non-profit institution.
  17.  *  Any  individual or group interested in seeing and/or using these
  18.  *  source files but who are prevented from doing so by the above
  19.  *  constraints should contact Don Wolfe, Assistant Vice-President for
  20.  *  Computer Systems at Brown University, (401) 863-7250, for possible
  21.  *  software licensing of the source developed at Brown.
  22.  *
  23.  *  Brown University and Peter John DiCamillo make no representations
  24.  *  about the suitability of this software for any purpose.
  25.  *
  26.  *  BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
  27.  *  EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
  28.  *  INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
  29.  *  WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  30.  *
  31.  */
  32.  
  33. #include <Files.h>
  34.  
  35. main(argc, argv)
  36. int argc; char * argv[];
  37. {
  38.  
  39. char vname[256];
  40. char fname[256];
  41. short vnum;
  42. OSErr rc;
  43. FInfo fndinfo;
  44.  
  45.  
  46. if (argc != 2) {
  47.     printf("Format: addshr filename\n");
  48.     return;
  49.     }
  50. strcpy(fname, argv[1]);
  51.  
  52. /* get volume number for default volume */
  53. rc = GetVol(vname, &vnum);
  54. if (rc != 0) {
  55.     printf("Error %d from GetVol\n", rc);
  56.     return;
  57.     }
  58.  
  59. rc = GetFInfo(fname, vnum, &fndinfo);
  60. if (rc != 0) {
  61.     printf("Error %d from GetFInfo\n", rc);
  62.     return;
  63.     }
  64.  
  65. fndinfo.fdFlags |= 0x40;    /* set shared bit */
  66.  
  67. rc = SetFInfo(fname, vnum, &fndinfo);
  68. if (rc != 0) {
  69.     printf("Error &d from SetFInfo\n", rc);
  70.     return;
  71.     }
  72.  
  73. }
  74.